-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sound addon #3494
sound addon #3494
Conversation
- working prototype for DECPS sequence (with blocking sound output) - hack to ask for sound permission from user action (needed for safari) - partial fix of screen update issue in inputhandler (needs real fix)
This is awesome! I rather like your tone generator - its seems less harsh than the MIDI synth I'm using. And your implementation seems fairly close to mine. I ran your example.sh test script on both terminals at the same time, and it sounded to me like your volume levels are about the same as mine. The only difference (other than the buffering) was when it got to the durations part of the test - my implementation seems to be interpreting the timing somewhat faster, so it ended up finishing about a second ahead of yours. I'm not sure if that's a real issue for one of us, or just a minor difference that ended up accumulating (possibly related to the buffering). Will need to double check my code. |
I think I found one genuine bug though. My understanding is that |
@j4james Thx for checking.
Oh I have not balanced the timings yet, there is a high chance, that the promise handling eats some microseconds here adding to a major offset in the end.
I wasnt sure about the meaning of zero there, so I went with "zero means one". I know thats a rather bold assumption, but not totally far fetched (as many DEC sequences have that ZDM defaulting to 1 thingy). Guess this needs to be checked against the real device as well. Added both to the TODO/reminder list. |
Again this was one of those things that wasn't clear on the page documenting the Play Sound control itself, but if you look in section 2.17 Sound, in the Set-Up chapter, it mentions that |
@j4james Fixed the "sound of silence". About the timings - it seems my timings have like +-10ms startup, while the runtime seems to shift by ~5ms average. I think I cannot get this more accurate for 2 reasons:
Edit: |
Thinking about proper blocking semantics - Before I can grab the device, here are some thoughts about a somewhat more useful blocking scheme than blocking on every single note:
Imho with such a model advanced text updates paired with sound output gets possible. Here the only challenge for app devs will be, to anticipate the latency of screen updates to not run into full buffer drains, thus to deliver shorter notes fast enough. And ofc they may not overdo the screen updates in between and cause other blocking reasons. |
Unlikely to happen, thus closing. |
WIP for a sound addon.
Currently working:
TODO:
onBell
eventThe early DECPS functionality can be tested with the example script:
$> addons/xterm-addon-sound/fixture/example.sh
Note: If the output stops at "C5" without any sound, click somewhere on the browser background (that click is currently hardlinked as user action to get the audio permissions).
Shall fix #3316, once we get to v5.